extends Spatial

# class member variables go here, for example:
# var a = 2
# var b = "textvar"
var player

func tryFindPlayer():
	player = get_tree().get_root().find_node("Player", true, false)


	
func _ready():
	#print ("cc ready")
	player = null
	set_physics_process(true)
	
	

func _physics_process(delta):


	if player != null:

		translation = player.translation
		rotation.y = player.rotation.y
		#if Input.is_key_pressed(KEY_O):
		#	rotate_y(deg2rad(2))
		#if Input.is_key_pressed(KEY_P):
		#	rotate_y(deg2rad(-2))
	else:
		tryFindPlayer()
	#pass

